/* ****************************************************************************
 *
 * Copyright (c) Microsoft Corporation. 
 *
 * This source code is subject to terms and conditions of the Microsoft Public License. A 
 * copy of the license can be found in the License.html file at the root of this distribution. If 
 * you cannot locate the  Microsoft Public License, please send an email to 
 * dlr@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
 * by the terms of the Microsoft Public License.
 *
 * You must not remove this notice, or any other, from this software.
 *
 * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
 * PARTICULAR PURPOSE.
 * ***************************************************************************/



#if !defined(AFX_PGLLINEHOR_H__C503FBE7_5D5B_49D1_9A81_8E1B24EEFB12__INCLUDED_)
#define AFX_PGLLINEHOR_H__C503FBE7_5D5B_49D1_9A81_8E1B24EEFB12__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <pgl/core/PGLLine.h>

/*! \brief An horizontal line.

\ingroup PGLLineGroup
*/
class PGLCORE_EXT_CLASS CPGLLineHor : public CPGLLine  
{
PGL_DECLARE_DYNCREATE(CPGLLineHor);
public:
	//! \name Constructors
	//@{
	//! Default construtor
	CPGLLineHor();
	//! copy constructor
	CPGLLineHor(const CPGLLineHor& lv) { *this=lv;};
	//! assignement constructor
	CPGLLineHor& operator = (const CPGLLineHor& lv);
	//! Default destructor
	virtual ~CPGLLineHor();
	//@}
	
	//! \name Vertical position
	//@{
	//! Sets horizontal position
	void SetY(double Y) {	m_dY = Y;};
	//! Returns horizontal position
	double GetY() const {	return m_dY;};
	//@}
	
	//! \name Caption
	//@{
	//! Sets caption
	void SetCaption( const CPGLText& caption)	{ m_tCaption = caption;};
	//! Set caption text
	void SetCaption( LPCTSTR szCaption)	{ m_tCaption.SetString(szCaption);};
	//! returns caption object
	const CPGLText& GetCaption() const	{	return m_tCaption;};
	//! returns caption text
	LPCTSTR GetCaptionString() const	{	return m_tCaption.GetString();};
	//@}

	//! \name Virtual plotting override
	//@{
    //! returns the extent of the datas
    virtual void GetUnionExtent(gfxinterface::CGfxInterface& gfx, CPGLRectD& rExtent);
	//! Main plot function
	void PlotGfx(gfxinterface::CGfxInterface& gfx);
	//! Draws legend
	void PlotLegendGfx(gfxinterface::CGfxInterface& gfx, const CPGLRectD& rBox);
	//@}

	//! \name Serialization and Debug
	//@{
	//! Save settings
	void SerializeXML(CPGLArchive& ar);

    #ifdef _DEBUG
        virtual void Dump( CDumpContext& dc ) const;
        virtual void AssertValid() const; 
    #endif
    //@}

protected:
	/*! \name Attributes
	*/
	//@{
	//! vertical position
	double m_dY;
	//! Caption
	CPGLText m_tCaption;
	//@}
};

PGL_DECLARE_SMARTPTR( CPGLLineHor );

#endif // !defined(AFX_PGLLINEHOR_H__C503FBE7_5D5B_49D1_9A81_8E1B24EEFB12__INCLUDED_)
